package com.biglead.demo.controller;


import com.biglead.demo.common.PageRequest;
import com.biglead.demo.common.R;
import com.biglead.demo.pojo.UserInfo;
import com.biglead.demo.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
@Api(tags="用户模块")
@RestController
@RequestMapping("user")
public class UserController {
    @Resource
    private UserService userService;
    @GetMapping(value="/list")
    @ApiOperation(value = "获取所有的用户")
    public R hello() {
        List<UserInfo> userInfoList = userService.findList();
        return R.okData(userInfoList);
    }

    @PostMapping(value="/findPage")
    @ApiOperation(value = "分页查询")
    public Object findPage(@RequestBody PageRequest pageQuery) {
        return userService.findPage(pageQuery);
    }
}
